{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "c61bf332",
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "a09142e3",
   "metadata": {},
   "outputs": [],
   "source": [
    "x = range(-5,5,1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "bbe51b26",
   "metadata": {},
   "outputs": [],
   "source": [
    "y = range(10,0,1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "9f2e09b3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAEPCAYAAABGP2P1AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAn2klEQVR4nO3dd3yV9d3G8c83OyGJJBCmDJkyCgGCgiICarVYxQWKFcWFdSBa9EFEXI/VPk9btaLlKYqAolCl1lpqW5VZK0MQwooMkb0JI4yY9Xv+SKQchmT/TnKu9+t1Xjm5z33uc+UEcp3fPc05h4iIyPfCfAcQEZHgomIQEZEAKgYREQmgYhARkQAqBhERCRDhO0B5qF27tmvatKnvGCIiVcrixYv3OOdSTpxeLYqhadOmLFq0yHcMEZEqxcw2nmq6ViWJiEgAFYOIiARQMYiISAAVg4iIBFAxiIhIAG/FYGaNzGyWmWWY2UozG1Y0/Wkz22pmS4tufX1lFBEJRT53V80DhjvnvjKzBGCxmX1a9NhLzrnfeMwmIhKyvBWDc247sL3ofpaZZQANKzPDL994gU0Jsfzhxocq82VFgtJ3331HZmYmWVlZ5Ofn+44jpRAeHk5CQgLJyclER0eXejlBcYCbmTUFOgELgAuBB8zsVmARhaOKfad4zhBgCEDjxo1L9boZtc5i1lnnsfiLz+hywaWlTC9S9X333Xds2rSJpKQkmjZtSmRkJ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       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "def calXnew(Xold):\n",
    "    return 1/Xold + Xold / 2\n",
    "Xold = 50\n",
    "Xnew = 0\n",
    "i = 0\n",
    "listXnew = []\n",
    "list_i = []\n",
    "listdiff = []\n",
    "\n",
    "while True > 0.0000001:\n",
    "    Xnew = calXnew(Xold)\n",
    "    listXnew.append(Xnew)\n",
    "    list_i.append(i)\n",
    "    difference = abs(Xnew - Xold)   \n",
    "    Xold = Xnew\n",
    "    \n",
    "    plt.plot(list_i,listXnew)\n",
    "    plt.axhline(1.414)\n",
    "   \n",
    "    plt.xlabel(\"i\",fontsize = 20)\n",
    "    plt.ylabel(\"Xnew\",fontsize = 18)\n",
    "    plt.legend([\"Xnew\",\"1.414\"],fontsize = 18)\n",
    "    i += 1\n",
    "    #print(i,Xnew)\n",
    "    if difference < 0.0000001:\n",
    "        break\n",
    "        #此时Xold = 2.5"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
